package org.hako.recite.word.test.impl;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 * Set implement of {@link TestWordIndexSet}.
 * 
 * @author xnnyygn
 */
public class SetTestWordIndexes implements TestWordIndexes {

    private Set<Integer> set;

    /**
     * Create. Copy constructor.
     * 
     * @param set 
     */
    public SetTestWordIndexes(Set<Integer> set) {
        super();
        this.set = new HashSet<Integer>(set);
    }

    @Override
    public Iterator<Integer> iterator() {
        return set.iterator();
    }

    @Override
    public int count() {
        return set.size();
    }
}
